package com.xzy.springcloud.contoller;

import com.xzy.springcloud.pojo.CommonResult;
import com.xzy.springcloud.pojo.Payment;
import com.xzy.springcloud.service.IFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class OrderController {
    @Autowired
    IFeignService feignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPayment(@PathVariable("id") Long id){
        //feign实现rpc调用（restTemp是在此处指定uri，feign是由此接口实现类自主进行rpc调用）
       return feignService.getbyId(id);

    }



}
